package com.luoye.sh.ws;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

/**
 * Created by Administrator on 2018/5/31.
 */
@Api(description = "打招呼",value = "hello")
@RestController
@RequestMapping("/hello")
public class HelloResource {

    @Value("${server.port}")
    String port;

    @ApiOperation(value="说出用户名", notes="根据名称获取名称和服务端口")
    @ApiImplicitParam(name = "name", value = "名称", required = true, dataType = "String", paramType = "query")
    @RequestMapping(value = "/say",method = RequestMethod.GET)
    public String say(@RequestParam String name){

        return "hi "+name+",i am from port:" +port;
    }

}
